/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.entities;

import br.com.deployment.enums.TypeAdmission;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;

/**
 *
 * @author roniere
 */
/**
 * Cartório Notarial
 *
 * @author roniere
 */
@Entity
public class NotaryOffice implements Serializable {

    @Id
    @SequenceGenerator(name = "seq_notary", sequenceName = "seq_notary", allocationSize = 1)
    @GeneratedValue(generator = "seq_notary", strategy = GenerationType.SEQUENCE)
    private Long id;
    
    @Column
    private Long cod;
    
    @Column
    private String nome;
   
    @Column
    private String titular;
    
    @Column
    private String denominationOffice;
    
    @Column
    private String natureOffice;
    
    @Column
    private String email;
    
    @Column
    private String cpf;
    
    @Enumerated(EnumType.ORDINAL)
    private TypeAdmission admission;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date datePossesion;
    
    @Column
    private String Cnpj;
    
    @OneToOne(cascade= CascadeType.ALL)
    private Address address;

    public NotaryOffice() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getTitular() {
        return titular;
    }

    public void setTitular(String titular) {
        this.titular = titular;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public Long getCod() {
        return cod;
    }

    public void setCod(Long cod) {
        this.cod = cod;
    }

    public String getDenominationOffice() {
        return denominationOffice;
    }

    public void setDenominationOffice(String denominationOffice) {
        this.denominationOffice = denominationOffice;
    }

    public String getNatureOffice() {
        return natureOffice;
    }

    public void setNatureOffice(String natureOffice) {
        this.natureOffice = natureOffice;
    }

    public TypeAdmission getAdmission() {
        return admission;
    }

    public void setAdmission(TypeAdmission admission) {
        this.admission = admission;
    }

    public Date getDatePossesion() {
        return datePossesion;
    }

    public void setDatePossesion(Date datePossesion) {
        this.datePossesion = datePossesion;
    }

    public String getCnpj() {
        return Cnpj;
    }

    public void setCnpj(String Cnpj) {
        this.Cnpj = Cnpj;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = cpf;
    }
    
    
    
    @Override
    public int hashCode() {
        int hash = 3;
        hash = 53 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final NotaryOffice other = (NotaryOffice) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "NotaryOffice{" + "id=" + id + ", cod=" + cod + ", nome=" + nome + ", titular=" + titular + ", denominationOffice=" + denominationOffice + ", natureOffice=" + natureOffice + ", email=" + email + ", cpf=" + cpf + ", admission=" + admission + ", datePossesion=" + datePossesion + ", Cnpj=" + Cnpj + ", address=" + address + '}';
    }

   

   
    
    
}
